We used Android Studio IDE for developing Blue Bus app. It is the best android development tool and provides easy to use platform and testing on our devices. It also includes android device simulators if no real hardware is available for testing.
We also used Google Maps API in our app for location selection.It is a powerful API and to use it, app needs to register Google Maps API for itself with a gmail account in Google Developers Console. With the unique google_maps_key given by Google Developers Console, the app can search for a place with an address or postcode(as powerful as Google Map).
In order to deliver satisiable performance and functionality for backend, we tried to cover any possible exceptions that might cause app to crash. Crashing of app can be very annoying and is the last thing you want, if you want to ensure good user experience.
We wrote several methods(if statements) to make sure the input is valid. For example, we use isValidLocation to check whether the location that user entered is an ATOS office. It strictly outlines what input the app expects and prevents the app from crashing. IsValidDate similarly checks if the date and time inserted by the user is valid. It checks to allow only future time to be inserted as depart date and also makes sure that return date and time is later than depart date and time.
When user registers, system requires all necessarry fields to be filled - registration won’t be completed until all required details are provided. System checks for validity of email (wheteher is can be considered a valid email address and if it already exists in app’s database) and password (min length being 5 characters) and also makes sure age field is filled with a digit. Because age is stored as an integer in database, so entering non-digit symbols can cause database related errors which would effect performance of the app negatively.
We used SharedPreference to transfer small pieces of data through different app pages(intents). SharedPreference is an Android class that allows programmers to store and access primitive types of data quickly.
For large amount of data like user records and ride records, we use MySQL since it's easy to use, secure and scalable. Also, it can store more complicated types of data like datetime. It allows comparison of datetime which is complicated in other languages, so we can search in a range of time around (10 days earlier and a month later than) the date that user enters.
Scripting languages are used to establish connection with database. Database connection is required when user registers, logs in, publishes a ride or books a ride. We used hostinger.co.uk hosting service for database management and storing php scripts.
For the general UI appearance of the app we utililized Android’s Navigation Drawer design pattern. After doing research for choosing right UI template out of many, we decided to stick with Navigation Drawer design. It is easy to implement for developers and offers comfortable user experience. Pressing navigation bar icon or swiping finger from left side of the screen shows navigation bar menu which includes links to all main pages of the app. This design pattern can be found in many apps in market because of its compact look and functionality.
We find Model-View-Presenter design pattern is better than Model-View-Control architechtural pattern for our app, although Model-View-Control is more widely known. An android application can hardly tell whether ‘Activity’ class is a controller or a view since it can not only contain the UI components but also handle UI components’ events. If we consider our application in Model-View-Presenter pattern, ‘Activity’ class, which is the entry point of an android application, is a view and handles UI components. The presenter controls the communication between the view and the model. For example, it receives the instruction from a view, sends a query to the model and updates the view. A model holds data, which is the MySQL database in our case. By implementing Model-View-Presenter pattern, we clearly know job of each part in our application and we can do unit testing on model, view and presenter separately.